package cn.run.java.domain;

import java.io.Serializable;
import java.util.Objects;

public class Blog implements Serializable {

  private Long id;

  private String name;

  public Long getId() {
    System.out.println("cn.run.java.domain.Blog$ getId");
    return id;
  }

  public void setId(Long id) {
    System.out.println("cn.run.java.domain.Blog$ setId");
    this.id = id;
  }

  public String getName() {
    System.out.println("cn.run.java.domain.Blog$ getName");
    return name;
  }

  public void setName(String name) {
    System.out.println("cn.run.java.domain.Blog$ setName");
    this.name = name;
  }

  @Override
  public boolean equals(Object o) {
    System.out.println("cn.run.java.domain.Blog$ equals");
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Blog blog = (Blog) o;
    return Objects.equals(id, blog.id) &&
      Objects.equals(name, blog.name);
  }

  @Override
  public int hashCode() {
    System.out.println("cn.run.java.domain.Blog$ hashCode");
    return Objects.hash(id, name);
  }

  public Blog() {
  }

  public Blog(Long id, String name) {
    System.out.println("cn.run.java.domain.Blog$ Blog ");
    this.id = id;
    this.name = name;
  }

  @Override
  public String toString() {
    return "Blog{" +
      "id=" + id +
      ", name='" + name + '\'' +
      '}';
  }
}
